<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>user</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
</head>
<body class="container">
<br/>
<h1>修改用户</h1>
<br/><br/>
<div class="with:80%">
    <form class="form-horizontal"   th:action="@{/user/update}"   method="post">
        <input type="hidden" name="id" th:value="${userInfo.getId()}"/>
        <div class="form-group">
            <label for="userName" class="col-sm-2 control-label">用户名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="username" th:value="${userInfo.getUsername()}"  id="userName" placeholder="用户名"/>
            </div>
        </div>
        <div class="form-group" >
            <label for="address" class="col-sm-2 control-label" >地址</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="address"
                       th:value="${userInfo.getAddress()}" id="address" placeholder="地址"/>
            </div>
        </div>
        <div class="form-group">
            <label for="birthday" class="col-sm-2 control-label">生日</label>
            <div class="col-sm-10">


                <input type="datetime-local" class="form-control" name="birthday"
                       th:value="${#dates.format(userInfo.getBirthday(), 'yyyy-MM-dd')+'T'+#dates.format(userInfo.getBirthday(), 'HH:mm:ss')}"
                       id="birthday" placeholder="生日"/>
            </div>
        </div>
        <div class="form-group">
            <label for="sex" class="col-sm-2 control-label">性别</label>
            <div class="col-sm-10">
                <label class="radio-inline">
                    <input type="radio" name="sex"  id="sex"  value="男"   checked> 男
                </label>
                <label class="radio-inline">
                    <input type="radio" name="sex" id="sex" value="女"
                           th:checked="${userInfo.getSex()=='女'?true:false}"> 女
                </label>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="Submit" class="btn btn-info" />
                &nbsp; &nbsp; &nbsp;
                <a href="/toAdd"  class="btn btn-info">Back</a>
            </div>

        </div>
    </form>
</div>
</body>
</html>
